@extends('admin.master')

@section('style')
	<link rel="stylesheet" href="{{ url('css/bootstrap-datetimepicker.css') }}">
	<link rel="stylesheet" href="{{ url('js/bootstrap-select/bootstrap-select.min.css') }}">
@endsection

@section('top')
<div class="top-breadcrumb pull-left">{!! Breadcrumbs::render() !!}</div>
@endsection

@section('content')
	<div class="container-body" id="view">
	{!! Form::open(['route' => 'admin.other-order.store', 'class'=>'form-horizontal']) !!}
		<input name="referer" type="hidden" value="{{ request()->header('referer') }}">
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">订单类型：</label>
			<div class="col-sm-8 row">
				{!! Form::select('type', config('system')['other_order_type'], 11, ['class'=>'form-control len150 selectpicker show-tick']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">生产类型：</label>
			<div class="col-sm-8 row">
				<label class="radio-inline"><input type="radio" name="ptype" value="1" v-model="product"> 定制单</label>
				<label class="radio-inline"><input type="radio" name="ptype" value="2" v-model="product"> PSD</label>
				<label class="radio-inline"><input type="radio" name="ptype" value="3" v-model="product"> 其他</label>
			</div>
		</div>
		<div class="web-label" v-show="product < 3">
			<div class="web-label-content">
				<div class="form-group">
					<label class="col-sm-4 control-label label-width">完成进度：</label>
					<div class="col-sm-8 row">
					{!! Form::select('progress', array_slice(config('system')['progress'], 1, null, true), 0, ['class'=>'form-control len150']) !!}
					</div>  
				</div>
				<div class="form-group">
					<label class="col-sm-4 control-label label-width">语言版本：</label>
					<div class="col-sm-8 row">
					{!! Form::select('languages[]', config('system')['language'], 0, ['class'=>'form-control len lan-select', 'multiple'=>'multiple']) !!}
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">
				<span class="text-danger">*</span> <span>客户名称：</span>
			</label>
			<div class="col-sm-6 row">
				{!! Form::text('name', null, ['class'=>'form-control len', 'data-rule'=>'required']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">
				<span>相关标签：</span>
			</label>
			<div class="col-sm-6 row">
				<input id="label-content" name="label" type="hidden">
				<p class="form-control-static label-list">
					@foreach(config('system.tag.other_order') as $value)
						<a href="javascript:;">{{ $value }}</a>
					@endforeach
				</p>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">周期：</label>
			<div class="col-sm-8 row">
				{!! Form::number('days', null, ['class'=>'form-control len', 'placeholder'=>'要求完成的天数']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">域名：</label>
			<div class="col-sm-8 row">
				<div class="input-group">
					<div class="input-group-addon">http://</div>
					{!! Form::text('domain', null, ['class'=>'form-control']) !!}
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">临时网址：</label>
			<div class="col-sm-8 row">
				{!! Form::text('temp_url', null, ['class'=>'form-control len']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">联系人：</label>
			<div class="col-sm-8 row">
				{!! Form::text('contact_people', null, ['class'=>'form-control len']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">手机号：</label>
			<div class="col-sm-8 row">
				{!! Form::text('phone', null, ['class'=>'form-control len']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">提成：</label>
			<div class="col-sm-8 row">
				{!! Form::number('commission', null, ['class'=>'form-control len', 'placeholder'=>'设计师的订单提成']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">设计师：</label>
			<div class="col-sm-8 row">
				{!! Form::select('designer_id', $designer, null, ['class'=>'form-control len','data-rule'=>'integer(+)', 'data-msg'=>'请选择设计师']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">备注：</label>
			<div class="col-sm-8 row">
				{!! Form::textarea('remark', null, ['class'=>'form-control len500', 'rows'=>5]) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width"></label>
			<div class="col-sm-8 row">
				{!! Form::submit('提交', ['class'=>'btn btn-primary btn-submit']) !!}
			</div>
		</div>
	{!! Form::close() !!}
	</div>
@endsection

@section('foot')
<script src="{{ url('js/nice-validator/jquery.validator.js?local=zh-CN') }}"></script>
<script src="{{ url('js/bootstrap-select/bootstrap-select.min.js') }}"></script>
<script src="{{ url('js/bootstrap-select/defaults-zh_CN.min.js') }}"></script>
<script type="text/javascript">

	$('.label-list').on('click', 'a', function() {
		$('.label-content').val();
	});

    $('.label-list').on('click', 'a', function(e) {
    	if ($(this).hasClass('active')) {
    		$('#label-content').val('');
    		$(this).removeClass('active');
    	} else {
    		$('#label-content').val($(this).text());
    		$(this).addClass('active').siblings().removeClass('active');
    	}
    });

	$('.selectpicker').selectpicker();
	$('.lan-select').selectpicker();

	new Vue({
		el: '#view',
		data: {
	    	product: 3,
		}
	})

</script>
@endsection